﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AlphaSolutionsGP.Demo_classes
{
    class EventDemo
    {
        Event e1;
        Event e2;
        private string passorfail;
        private int _pass;
        private int _fail;


        public EventDemo()
        {
            if ((testEventNoArgConstructor()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
            if ((testEventArgConstructor()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
            if ((testCreateEvent()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
            if ((testAmmendEvent()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
            if ((testDeleteEvent()) == false)
            {
                _fail++;
            }
            else
            {
                _pass++;
            }
        
        }

        bool testEventNoArgConstructor()
        {
            bool success = false;
            try
            {
                e1 = new Event();
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        bool testEventArgConstructor()
        {
            bool success = false;
            try
            {
                e2 = new Event(99,"test", "a test event", "1992-01-10","12:00", "High", "99100012","20010435");
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        bool testCreateEvent()
        {
            bool success = false;
            try
            {
                e2.createEvent();
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        bool testAmmendEvent()
        {
            bool success = false;
            try
            {
                e2.amendEvent();
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        bool testDeleteEvent()
        {
            bool success = false;
            try
            {
                e2.removeEvent();
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        bool testCopyEvent()
        {
            bool success = false;
            try
            {
                e1.copyEvent(e2);
                success = true;
            }
            catch (Exception e)
            {
                success = false;
            }
            return success;
        }
        public int Fail
        {
            get { return _fail; }
            set { _fail = value; }
        }

        public int Pass
        {
            get { return _pass; }
            set { _pass = value; }
        }


    }
}
